
#include <string>
#include <iostream>
#include <bitset>

using namespace std;

int main() {

  //std::vector<bool> v2(7,false);
  // int index = 1;
  // std::cout << (index<<0) << std::endl;
  // std::cout << (index<<1) << std::endl;
  // std::cout << (index<<2) << std::endl;
  // std::cout << (index<<3) << std::endl;
  // std::cout << (index<<4) << std::endl;
  char a = -128;
  char b = -127;
  char c = -1;
  char d = 0;
  char e = 127;
  std::cout << sizeof(a) << std::endl;
  auto negtive_most = bitset<sizeof(a)*8>(a);
  auto negtive_most_right1 = negtive_most >> 1;
  cout << "二进制： " << bitset<sizeof(a)*8>(a) << endl;
  cout << "二进制： " << bitset<sizeof(a)*8>(b) << endl;
  cout << "二进制： " << bitset<sizeof(a)*8>(c) << endl;
  cout << "二进制： " << bitset<sizeof(a)*8>(d) << endl;
  cout << "二进制： " << bitset<sizeof(a)*8>(e) << endl;

  char a1 = -128 >> 1;
  char a2 = a1 >> 1;
  std::cout << bitset<sizeof(a)*8>(a1) << std::endl;
  std::cout << bitset<sizeof(a)*8>(a2) << std::endl;

  unsigned char f = 128 ;
  unsigned char g = f>>1 ;
  unsigned char h = g>>1 ;

  std::cout << bitset<sizeof(f)*8>(f) << std::endl;
  std::cout << bitset<sizeof(f)*8>(g) << std::endl;
  std::cout << bitset<sizeof(f)*8>(h) << std::endl;

  std::cout << 0x10 << std::endl;

  // cout << "二进制： " <<  << endl;
  // cout << "二进制： " << bitset<sizeof(a)*8>(negtive_most_right1) << endl;

  return 0;
}